﻿
using Demo.Models.Enum;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace Demo.Models
{
    /// <summary>
    /// Class BasePermission.
    /// </summary>
    [Description("基础权限")]
    public class BasePermission : BaseEntity<long>
    {
      
        public BasePermission()
        {
            OrganizerDisable = false;
        }
        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the parent identifier.
        /// </summary>
        /// <value>The parent identifier.</value>
        public Nullable<long> ParentId { get; set; }

        /// <summary>
        /// 层级
        /// </summary>
        /// <value>The level.</value>
        public int Level { get; set; }

        
        /// <summary>
        /// 是否展开
        /// </summary>
        public bool Expanded { get; set; }

        /// <summary>
        /// 是否是子节点，树的最终节点，叶子
        /// </summary>
        public bool IsLeaf { get; set; }

        /// <summary>
        /// 是否加载
        /// </summary>
        public bool Loaded { get; set; }

        /// <summary>
        /// Gets or sets the icon.
        /// </summary>
        /// <value>The icon.</value>
        public string Icon { get; set; }

        /// <summary>
        /// Gets or sets the href.
        /// </summary>
        /// <value>The href.</value>
        public string Href { get; set; }

        /// <summary>
        /// Gets or sets the language key.
        /// </summary>
        /// <value>The language key.</value>
        public string LanguageKey { get; set; }

        /// <summary>
        /// 是否禁用
        /// </summary>
        /// <value><c>true</c> if this instance is disable; otherwise, <c>false</c>.</value>
        public bool IsDisable { get; set; }
        /// <summary>
        /// 请求类型
        /// </summary>
        /// <value>The type of the request.</value>
        public RequestType RequestType { get; set; }
        /// <summary>
        /// Url类型
        /// </summary>
        /// <value>The type of the action.</value>
        public ActionType ActionType { get; set; }

        /// <summary>
        /// 标识角色的是否对组织结构有效
        /// </summary>
        public bool OrganizerDisable { get; set; }
        /// <summary>
        /// Gets or sets the children.
        /// </summary>
        /// <value>The children.</value>
        public virtual BasePermission Parent { get; set; }
        /// <summary>
        /// Gets or sets the childrens.
        /// </summary>
        /// <value>The childrens.</value>
        public virtual ICollection<BasePermission> Childrens { get; set; }

        /// <summary>
        /// Gets or sets the base role permissions.
        /// </summary>
        /// <value>The base role permissions.</value>
        public virtual ICollection<BaseRolePermission> BaseRolePermissions { get; set; }
         
    }
}
